package com.fstec.ks.master.service.impl;

import org.springframework.beans.factory.annotation.Autowired;

import com.fstec.ks.master.dao.ServerInfoDao;
import com.fstec.ks.master.service.AuthService;
import com.fstec.ks.master.vo.ServerInfoVO;

public class DefaultAuthService implements AuthService {
	@Autowired
	private ServerInfoDao serverInfoDao;
	
	@Override
	public ServerInfoVO getServerInfo() {
		return this.serverInfoDao.select();
	}

	@Override
	public void addServerInfo(ServerInfoVO serverInfoVo) {
		this.serverInfoDao.insert(serverInfoVo);
	}

	@Override
	public int modifyAuth(String id, String newAuth) {
		return this.serverInfoDao.updateAuth(id, newAuth);
	}

	@Override
	public int modifyIpAddr(String id, String ipAddr) {
		return this.serverInfoDao.updateIpAddr(id, ipAddr);
	}
}
